# 安装文件判断是否存在
function(existsInstallFiles STAMP_DIR INSTALL_DIR MODULE_NAME)
# message(FATAL_ERROR "来过${INSTALL_DIR}")
set(FINE_LIST ${INSTALL_DIR}/install_files.txt)
if(EXISTS ${FINE_LIST})
    file(READ ${FINE_LIST} content)
    string(REPLACE "\n" ";" lines "${content}")
    foreach(line ${lines})
        string(STRIP ${line} line)
        if(NOT line STREQUAL "" AND NOT line MATCHES "^#" AND NOT EXISTS ${line})
            message(NOTICE "安装文件不完整 ${line}")
            # 先获取匹配的文件列表
            file(GLOB stamp_files "${STAMP_DIR}/${MODULE_NAME}-install*")
            # 删除每个文件
            foreach(file ${stamp_files})
                execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${file})
            endforeach()
            break()
        endif()
    endforeach()
    else()
        # 重新构建
        execute_process(COMMAND rm -rf ${STAMP_DIR})
endif()
endfunction()
